/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.partaljevic.tapestry.gambling.pages;

import com.partaljevic.tapestry.gambling.service.Customers;
import com.partaljevic.gambling.Customer;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.ioc.annotations.Inject;

/**
 *
 * @author Danilo
 */
public class Forgot {

    private String username;
    @Persist("flash")
    private String password;
    @Inject
    private Customers customers;
    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    void onSubmitFromForgotForm(){
        for (Customer customer : customers.retrieve()) {
            if(customer.getUsername().equals(username))password=customer.getPassword();
        }
    }


}
